package com.bamboo.toolbox.exporter.model;


import com.bamboo.toolbox.core.utils.JsonUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author luzhiqing
 * @version 1.0
 * @date 2022/10/22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Database {
    private String name;
    private String url;
    private String userName;
    private String password;

    public String toJson() {
        return JsonUtils.format(JsonUtils.toJson(this));
    }

    public Database fromJson(String json) {
        return JsonUtils.toObject(json, Database.class);
    }
}
